﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace MesProjectWinform.BasicData.Entity
{
    /// <summary>
    /// 产线实体类
    /// </summary>
    public class Productionline
    {
        /// <summary>
        /// 产线ID
        /// </summary>
        public long Id { get; set; }
        
        /// <summary>
        /// 产线名称
        /// </summary>
        public string Productionlinename { get; set; }
        
        /// <summary>
        /// 产线编号
        /// </summary>
        public string Productionlinecode { get; set; }
        
        /// <summary>
        /// 车间ID
        /// </summary>
        public string Workshopid { get; set; }
        
        /// <summary>
        /// 车间名称
        /// </summary>
        public string Workshopname { get; set; }

        /// <summary>
        /// 产线描述
        /// </summary>
        public string Productionlinedescription { get; set; }

        /// <summary>
        /// 产线属性
        /// </summary>
        public string Productionlineattributes { get; set; }

        /// <summary>
        /// 是否删除
        /// </summary>
        public bool IsDeleted { get; set; } = false;
        
        /// <summary>
        /// 创建人
        /// </summary>
        public string CreatedBy { get; set; }
        
        /// <summary>
        /// 创建时间
        /// </summary>
        public DateTime CreatedTime { get; set; } = DateTime.Now;
        
        /// <summary>
        /// 更新人
        /// </summary>
        public string UpdatedBy { get; set; }
        
        /// <summary>
        /// 更新时间
        /// </summary>
        public DateTime UpdatedTime { get; set; } = DateTime.Now;
    }
    
    /// <summary>
    /// 产线数据传输对象
    /// </summary>
    public class ProductionlineDto
    {
        /// <summary>
        /// 提示信息
        /// </summary>
        public string Message { get; set; } = string.Empty;
        
        /// <summary>
        /// 状态码
        /// </summary>
        public string Code { get; set; } = string.Empty;
        
        /// <summary>
        /// 数据列表，默认初始化为空列表避免空引用
        /// </summary>
        public List<Productionline> Data { get; set; } = new List<Productionline>();
        
        /// <summary>
        /// 总记录数，允许为null
        /// </summary>
        public int? TotalCount { get; set; }

        /// <summary>
        /// 获取总记录数，如果为null则返回0
        /// </summary>
        public int GetTotalCount()
        {
            return TotalCount ?? 0;
        }
    }
}
